﻿--
--
IF EXISTS (SELECT name FROM sysobjects WHERE name = 'dsZeusOpenPicking' AND type = 'P')
BEGIN
  DROP PROCEDURE dsZeusOpenPicking
END
GO

-- HU - Nyitott kiszedések
-- EN - Open Picking
--
CREATE PROCEDURE dsZeusOpenPicking
(@AccessToken INTEGER)
 AS
BEGIN
  DECLARE
    @Err INTEGER,
    @Rows INTEGER,
    @UserID INTEGER,
    @Lang NVARCHAR(10)

  EXEC @Err = spAccessTokenCheck @AccessToken, @UserID OUTPUT, @Lang OUTPUT

  IF (@Err != 0)
    GOTO __ERROR__


  -- HU - Nyitott kiszedések
  -- EN - Open pickings
  --

  SELECT TOP 20 
         ID, Code, PartnerName
    FROM ZeusPicking
   WHERE Status = 'O'

-- Well done.
--
  RETURN(0)

-- We have a problem !
--
__ERROR__:
  RETURN(1)
END
GO
